import sqlite3
conn = sqlite3.connect("./data.db")

conn.execute("""
CREATE TABLE JIANGYAN(
        ID INTEGER PRIMARY KEY AUTOINCREMENT,
        UPLOAD_TIME INTEGER,
        IMAGE BLOB,
        TEXT TEXT ,
        COMMENT TEXT,
        MESSAGE_ID INTEGER
)
""")
try:
#     conn.execute("CREATE INDEX INDEX_ID ON JIANGYAN(ID)")
    conn.execute("CREATE INDEX INDEX_UPLOAD_TIME ON JIANGYAN(UPLOAD_TIME)")
    conn.execute("CREATE INDEX INDEX_MSG_ID ON JIANGYAN(MESSAGE_ID)")
except Exception as ex:
    print(ex)
conn.commit()
